﻿using System;
using System.Collections.Generic;
using System.Text;

using Daybreak.Core.Rendering;

namespace Daybreak.Core
{
    public partial class Scene
    {
        /// <summary>
        /// Declares a module of Geometry objects
        /// </summary>
        public class GeometryLib
        {
            public List<Geometry> GeometryList = new List<Geometry>();

            public GeometryLib() { }

            public Geometry AddGeometry(string name)
            {
                Geometry geom = FindByName(name);

                if (geom == null)
                {
                    geom = new Geometry();
                    geom.Name = name;
                    GeometryList.Add(geom);
                }

                return geom;
            }

            public Geometry FindByName(string name)
            {
                for (int i = 0; i < GeometryList.Count; i++)
                    if (GeometryList[i].Name == name)
                        return GeometryList[i];

                return null;

            }
        }

    }
}
